package com.oa.srms.apps.business.goods.impl;

import org.springframework.beans.factory.annotation.Autowired;
import com.oa.srms.apps.business.goods.IGoodForCategoryService;
import com.oa.srms.apps.dao.goods.IGoodForCategoryDao;
import com.oa.srms.apps.entity.goods.GoodForCategoryValue;

public class GoodForCategoryServiceImpl implements IGoodForCategoryService {
	@Autowired
	private GoodForCategoryValue goodForCategory;
	@Autowired
	private IGoodForCategoryDao goodForCategoryDao;
	
	@Override
	public boolean addOrModifyGoodForCategory(int categoryId, String goodIds)
			throws Exception {
		goodForCategory.setCategoryId(categoryId);
		goodForCategory.setGoodIds(goodIds);
		return goodForCategoryDao.addOrModifyGoodForCategory(goodForCategory);
	}

	@Override
	public GoodForCategoryValue queryByCategoryId(int categoryId)
			throws Exception {
		goodForCategory.setCategoryId(categoryId);
		return goodForCategoryDao.queryByCategoryId(goodForCategory);
	}

}
